 <toolbar id="toolbar">
	<form id="statistics_search" class="form-horizontal" style="margin:0">
		<div class="clearfix">
			<div class="pull-left">
				<div class="control-group">
					<label class="control-label" style="width: 120px;">开始时间</label>
					<div class="controls" style="margin-left:125px;">
						<div class="input-append date" data-format="yyyy-MM-dd hh:mm:ss">
							<input type="text" name="start_date" value="{$search.start_date}"style="width: 130px;">
							<span class="add-on"><i class="icon-th"></i></span>
						</div>
						至
						<div class="input-append date" data-format="yyyy-MM-dd hh:mm:ss">
							<input type="text" name="end_date" value="{$search.end_date}" style="width: 130px;">
							<span class="add-on"><i class="icon-th"></i></span>
						</div>
					</div>
				</div>
	   		</div>
		</div>
	</form>
</toolbar>

<!-- 表格 -->
<table id="table" data-toggle="gridview" class="table table-hover" data-url="__URL__" data-toolbar="#toolbar" data-show-columns="true" data-side-pagination="client">    
    <thead>
		<tr>
			<th data-width="100" data-field="sold_num">实际销售数量</th>
			<th data-width="200"  data-field="title">产品名称</th>
			<th data-width="200"  data-field="spec">产品规格</th>
			<th data-width="80"  data-field="trade_num">包含产品的订单数量</th>
			<th data-width="100"  data-field="order_num">产品总下单次数</th>
			<th data-width="100"  data-field="order_cancel_num">产品退货次数</th>
			<th data-width="100"  data-field="sold_cash">成交总金额</th>
			<th data-width="100"  data-field="agent2_price">员工价</th>
			<th data-width="100"  data-field="agent3_price">会员价</th>
			<th data-field="price">零售价</th>
		</tr>
	</thead>
</table>

<script type="text/javascript">
$(function(){
	// 打单并发货
	$('#table').on('exportsale', function(){
		var data = $('#statistics_search').serializeArray();
		var url = '__URL__/exportSale?';
		for(var i=0; i<data.length; i++){
			url += (i > 0 ? '&' : '')+data[i].name+'='+data[i].value;
		}
		window.location.href = url;
		return false;
	});
});
</script>